<?php
function ListContentNews($idP)
{
    global $dbsql,$language,$module;

    $sql_where  = "from tblnews_content where cLanguage = '$language' ";
    if($idP>0)
    {
        $sql_where.= " and iParentId = $idP ";
    }
     //get limit to split page:
    $sql_select     = "select count(iId) as count ".$sql_where;
    $result         = $dbsql->query_fetch($sql_select);
    $count_all      = $result['count'];
    list($limit_st,$limit_le)	=Slit_Page($count_all);

    //load contents news
    $sql_select     = "select * ".$sql_where." order by iOrder limit $limit_st,$limit_le";
    return $dbsql->load($sql_select);
}

function hasChildContentNews($idp)
{
    global $dbsql;
    $idp=intval($idp);
    //-----------------------------------------------------
    $sql_select = "select iId from tblnews_content where  iParentId = $idp";

    $rs=$dbsql->query($sql_select);
    $rows = $dbsql->num_rows($rs);
    if($rows>0)return true;
    return false;
}
?>